﻿Public Class ParticipanteNegocio

    Public Sub actualizar(ByVal idParticipante As Integer, ByVal nombre As String, ByVal apellido As String, ByVal fecha As String, ByVal sexo As String,
                          ByVal correo As String, ByVal direccion As String)

        Dim modelo As New Participante()
        modelo.idParticipante = idParticipante
        modelo.NombreParticipante = nombre
        modelo.Apellido = apellido
        modelo.Fech_nac = fecha
        modelo.Sexo = sexo
        modelo.Correo = correo
        modelo.Direccion = direccion

        Dim dao As New ParticipanteDAO
        dao.actualizar(modelo)
    End Sub

    Public Function insertar(ByVal NombreParticipante As String, ByVal Apellido As String, ByVal Fech_nac As String,
                             ByVal Sexo As String, ByVal Correo As String, ByVal Direccion As String) As Participante

        Dim part As New Participante()

        part.NombreParticipante = NombreParticipante
        part.Apellido = Apellido
        part.Fech_nac = Fech_nac
        part.Sexo = Sexo
        part.Correo = Correo
        part.Direccion = Direccion

        Dim dao As New ParticipanteDAO
        Return dao.insertar(part)
    End Function


    Public Function obtener(ByVal idParticipante As Integer) As Participante
        Dim dao As New ParticipanteDAO
        Return dao.obtener(idParticipante)
    End Function

    Public Function listar() As Collection
        Dim dao As New ParticipanteDAO
        Return dao.listar()
    End Function

    Public Function buscarPorNombre(ByVal nombre As String) As Collection
        Dim dao As New ParticipanteDAO
        Return dao.buscarPorNombre(nombre)
    End Function


End Class
